/*
 * Font.h
 *
 *  Created on: Jul 18, 2009
 *      Author: kurt
 */

#ifndef FONT_H_
#define FONT_H_

#include "Object.h"
#include "Color.h"
#include "Sprite.h"
#include <string>
#include <cstdarg>

namespace objdraw 
{
//TODO finish this class
class Font: public objdraw::Object 
{
	protected:
		virtual ~Font();
		Font(const Font & f);
		
		Sprite * font;
		
	public:
		
		virtual inline void Delete(){ delete this; }
		Font();
		Font(std::string file, unsigned int opts = 0);
		
		void setStyle(float size, Color color, Color shadowColor, unsigned int options);
		void setEncoding(unsigned int options);
		void setAlternateFont(Font * f);
		
		bool fontIsLoaded();
		class Sprite * getFont();
		
		float print        (float x, float y, const char *text);
		float printEx      (float x, float y, const char *text, int length);
		float printColumn  (float x, float y, float width, const char *text);
		float printColumnEx(float x, float y, float width, const char *text, int length);
		
		float printf        (float x, float y, const char *text, ...);
		
		float measureText  (const char *text);
		float measureTextEx(const char *text, int length);
	
	friend class Text;
};

}

#endif /* FONT_H_ */
